home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Python 1.3 / source code / Nt / make.nt.in < prev    next >
Encoding:
Text File  |  1995-12-17  |  2.6 KB  |  92 lines  |  [TEXT/R*ch]

  1.  
  2. !include <ntwin32.mak>    # bring in platform specific stuff.
  3.  
  4. #Fix a problem with ntwin32.mak and Visual C++
  5. # problem is .mak defines "link=link32" and "lib=lib32"
  6. # Problem is MSVC linker/library manager use these environment
  7. # variables as additional flags to link/lib
  8. # Consequently, link warns "link32.obj not found" and similarly lib.
  9. #   This has really p___ed me of.  It has been very hard to get right.
  10. #   The LIB variable is used by MSVC to locate system library files, and
  11. #    damn ntwin32.mak sets lib.  Now although NMAKE is case sensitive, the OS'
  12. #   environment vars arent.  Therefore /E option _must_ be specified for MSVC
  13. # nmake itself is also very average :-(
  14. #
  15.  
  16. # Damn it.  Even with .DLL in the suffixes, nmake wont infer a line
  17. # mymodule.dll:
  18. # and run up the .c->.obj, .obj->.dll.  And with all debug turned on, all
  19. # it says is "dont know how to make .."  Damn it (probably me, but I gave up:)
  20. #.SUFFIXES :
  21. #.SUFFIXES : .exe .dll .obj .asm .c .cpp .cxx .bas .cbl .for .pas .res .rc
  22.  
  23. linker=$(link)
  24. libmgr=$(implib)
  25. LINK=
  26.  
  27. #cdebug = -Z7 -Od    # Z7 for win32s debugging
  28.  
  29. # Note that srcdir is relative to the subdirs, not the top level.
  30. srcdir=..
  31.  
  32. #
  33. # Additional common definitions
  34. #
  35. cinclude=/I$(srcdir)\Include /I$(srcdir)
  36. python_defs_lib=$(srcdir)\Modules\pythondefs.lib
  37. python_defs_exp=$(srcdir)\Modules\pythondefs.exp
  38. pythonopts=/DHAVE_CONFIG_H /DNT /nologo /MD /G3
  39.  
  40.  
  41.  
  42. # Fine tune optimiser (platform (and realistically, compiler version) specific)
  43. !if "$(CPU)" != "i386"
  44. !else ifdef NODEBUG
  45. # for Intel processors
  46. cdebug=/Ob1 /Oi /Ot /Oy /Gs # This is /Ox minus /Og
  47. !endif
  48.  
  49. !IFDEF MSVC
  50. # Although this is handled, it generates warning.  This is to avoid them
  51. cc=cl
  52. linker=link
  53. libmgr=lib
  54. !ENDIF
  55.  
  56. !ifndef BUILD_DL
  57. .c.obj:
  58.     $(cc) $(cflags) $(ccustom) $(cdebug) $(cinclude) $(pythonopts) $*.c
  59. !else
  60. #
  61. # Useful stuff for building DL modules under NT.
  62. #
  63.  
  64. #if you have a .DEF file, define HAVE_DEF
  65. # if you dont want precompiled headers, define PCH=0 (in your makefile, not here!)
  66. !ifndef PCH
  67. PCH=1
  68. !endif
  69. !if "$(PCH)"=="1"
  70. cpch=/YX
  71. !else
  72. cpch=
  73. !endif
  74.  
  75. !ifdef HAVE_DEF
  76. export_statements=/DEF:$*.def 
  77. !else
  78. export_statements=/EXPORT:init$(*:module=) 
  79. !endif
  80. # Note for 'C', I use /Tp, to force as CPP - this will allow .C to define types.
  81. .c.obj:
  82.     @echo Warning - compiling as C++ file
  83.     $(cc) $(cflags) $(ccustom) $(cdebug) $(cinclude) $(cpch) $(pythonopts) /DUSE_DL_IMPORT /Tp $*.c
  84.  
  85. .cpp.obj:
  86.     $(cc) $(cflags) $(ccustom) $(cdebug) $(cinclude) $(cpch) $(pythonopts) /DUSE_DL_IMPORT $*.cpp
  87.  
  88. .obj.dll:
  89.     link -dll -out:$*.dll $*.obj $(ldebug) $(export_statements) $(lcustom) $(python_defs_lib)
  90.  
  91. !endif
  92.